/*********************************************
kasm.h

************************************************/

#include "defs.h"


int _GetESP();
int 		_read_cr0();
void		_write_cr0(unsigned long * ptr);

int 		_read_cr3();
void        _write_cr3(unsigned long * ptr);

void 		ssf_hand();				// stack exception handler
void 		gpf_hand();				// general protection handler
void 		snp_hand();				// segment not present handler
void 		pf_hand();				// page fault handler

unsigned int _read_msw();

void _lidt (IDTR *idtr);

void _mascaraPIC1 (byte mascara);   /* Escribe mascara de PIC1 */
void _mascaraPIC2 (byte mascara);   /* Escribe mascara de PIC2 */

void _Cli(void);                    /* Deshabilita interrupciones  */
void _Sti(void);                    /* Habilita interrupciones  */

void _int_08_hand();                /* Timer tick */
void _int_80_hand();                /* Kernel Read/Write */
void _int_09_hand();                /* Keyboard */

void _restart(void);
void _int8(void);

int _write(int fd, const void *buf, size_t count);

int _read(int fd, void *buf, size_t count);

void ioOut( unsigned short port, unsigned char data);

void ioIn(unsigned char * buf, unsigned short port);

void _debug(void);



